package cn.wolfcode.trip.base.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 订单表
 */
@Getter@Setter
public class OrderList extends BaseDomain{
    //完成
    public static final int STATE_DONE=1;
   //未完成
    public static final int STATE_UNDONE = 2;
    //商品id
    private Product product;
    //关联用户
    private User user;

    //创建时间
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date creationtime;
    //商品积分
    private Integer price;
    //状态
    private Integer statu=STATE_DONE;
    public String getStatuDisplay(){
        if(statu==0){
            return "正常";
        }
        if(statu==1){
            return "推荐";
        }
        return "";
    }
}